from django.urls import path
from .views import ImageView, LoginView, HomeView, UserViews, UserViewsTow
from .views_management import MenusView, MenusViewTow, RanksView, RanksViewTow, ManagementsView, ManagementsViewTow
from .views_management import DepartmentView, DepartmentViewTow, RolesViews, RolesViewsTow

urlpatterns = [
    # 图片验证码
    path('imgcode/<str:uuid>/', ImageView.as_view()),

    # 登录
    path("login/", LoginView.as_view()),

    # 获取所有的生日信息
    path("birthdays/", HomeView.as_view({"get": "user_cunt"})),

    # 获取所有的职别信息
    path("empdats/", HomeView.as_view({"get": "use_empdats"})),

    # 用户信息管理
    path("systemusers/", UserViews.as_view({"get": "all_user", "post":"add_user"})),

    # 用户管理2
    path("reviseuser/<int:pk>/", UserViewsTow.as_view({"get":"one_user", "put": "upd_user"})),

    # 菜单管理
    path("menus/", MenusView.as_view({"get":"all_menu", "post":"add_menu"})),

    # 菜单管理tow
    path("revisemenu/<int:id>/", MenusViewTow.as_view({"get":"one_menu", "put": "upd_menu", "delete": "del_menu"})),

    # 职级管理
    path("ranks/", RanksView.as_view({"get":"all_rank", "post": "add_rank"})),

    # 职级管理Tow
    path("reviserank/<int:pk>/", RanksViewTow.as_view({"get": "one_rank", 'put': "upd_rank", "delete": "def_rank"})),

    # 岗位管理
    path("managements/", ManagementsView.as_view({"get":"get_managements", "post":"add_managements"})),

    # 岗位管理2
    path("resivement/<int:pk>/", ManagementsViewTow.as_view({"get": "one_managements", "put":"upd_managements", "delete":"del_managements"})),

    # 部门管理
    path("departments/", DepartmentView.as_view({"get": "get_department", "post": 'add_department'})),

    # 部门管理2
    path("resivesector/<int:pk>/", DepartmentViewTow.as_view({"get": "one_department", "put": "upd_department", "delete": "del_department"})),

    # 角色管理
    path("roles/", RolesViews.as_view({"get":"get_role", "post": "add_role"})),

    # 角色管理2

    path("reviserole/<int:pk>/", RolesViewsTow.as_view({"get":"one_role", "delete":"del_role", "put":"upd_role"})),
]
